package com.lry.basic.jvm.staticDispatch;

/**
 * @author:刘仁有
 * @desc: 静态分派：典型是方法重载，发生在编译阶段
 * @email:953506233@qq.com
 * @data:2019/12/10
 */
public class StaticDispatch {
    //byte(1),boolean(1),short(2),char(2),int(4),float(4),long(8),double(8)
    public static void main(String[] args) {
        //外观类型/静态类型     实际类型
        //方法重载只会根据参数的外观类型
        Human man = new Man();
        Human woman = new Woman();
//        StaticDispatch sd = new StaticDispatch();
        say(man);
        say(woman);
    }

    public static void say(Human human){
        System.out.println("human");
    }
    public static void say(Man man){
        System.out.println("man");
    }
    public static void say(Woman woman){
        System.out.println("woman");
    }
}
